package com.gjy.concurrency.beautiful;

import org.junit.jupiter.api.Test;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-06-16 09:48:05
 */
public class QueueTest {

    @Test
    public void test2() {
        LinkedBlockingQueue<Integer> queue = new LinkedBlockingQueue<>();
        LinkedBlockingDeque<Integer> deque = new LinkedBlockingDeque<>();

    }

    @Test
    public void test1() {
        ConcurrentLinkedQueue<Integer> queue = new ConcurrentLinkedQueue<>();

        queue.offer(1);

        Integer poll = queue.poll();
        Integer poll2 = queue.poll();
        System.out.println(poll);
        System.out.println(poll2);
        System.out.println(queue);
    }
}
